<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <!-- Arcade uses by default xunit as test runner, illink uses nunit instead. -->
    <TestRunnerName>NUnit</TestRunnerName>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.DotNet.Cecil" Version="$(MicrosoftDotNetCecilVersion)" PrivateAssets="All" Publish="True" />
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" />
    <ProjectReference Include="$(RepoRoot)\src\coreclr\tools\ILVerification\ILVerification.csproj" />
    <!-- This reference is purely so that the ILLink can resolve this
         dependency of mscorlib. It is not actually required to build
         the tests. -->
    <PackageReference Include="System.Threading.AccessControl" Version="$(SystemThreadingAccessControlVersion)" />

    <ProjectReference Include="..\..\src\linker\Mono.Linker.csproj" SkipUseReferenceAssembly="true" />
    <ProjectReference Include="..\Mono.Linker.Tests.Cases\**\*.csproj" />
    <ProjectReference Include="..\Mono.Linker.Tests.Cases.Expectations\Mono.Linker.Tests.Cases.Expectations.csproj" />
  </ItemGroup>

  <!-- Tests require ilasm so we make sure that it is live built before executing the tests. -->
  <ItemGroup>
    <ProjectReference Include="$(CoreClrProjectRoot)runtime.proj"
                      AdditionalProperties="ClrILToolsSubset=true;Configuration=$(CoreCLRConfiguration)"
                      ReferenceOutputAssembly="false"
                      SkipGetTargetFrameworkProperties="true" />
  </ItemGroup>

  <ItemGroup>
    <None Update="TestCases\Dependencies\PInvokesExpectations.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>

    <RuntimeHostConfigurationOption Include="Mono.Linker.Tests.Configuration">
      <Value>$(Configuration)</Value>
    </RuntimeHostConfigurationOption>
    <RuntimeHostConfigurationOption Include="Mono.Linker.Tests.ILToolsDir">
      <Value>$(CoreCLRArtifactsPath)</Value>
    </RuntimeHostConfigurationOption>
    <RuntimeHostConfigurationOption Include="Mono.Linker.Tests.ArtifactsBinDir">
      <Value>$(ArtifactsBinDir)</Value>
    </RuntimeHostConfigurationOption>
    <RuntimeHostConfigurationOption Include="Mono.Linker.Tests.LinkerTestDir">
      <Value>$(LinkerTestDir)</Value>
    </RuntimeHostConfigurationOption>
    <RuntimeHostConfigurationOption Include="Mono.Linker.Tests.TargetFramework">
      <Value>$(TargetFramework)</Value>
    </RuntimeHostConfigurationOption>
    <!-- Used in testcase to check the cecil package version. -->
    <RuntimeHostConfigurationOption Include="Mono.Linker.Tests.CecilPackageVersion">
      <Value>$(MicrosoftDotNetCecilVersion)</Value>
    </RuntimeHostConfigurationOption>
  </ItemGroup>

  <Import Project="..\Trimming.Tests.Shared\Trimming.Tests.Shared.projitems" Label="Shared" />

</Project>
